from rest_framework.response import Response
from rest_framework.views import APIView

from six_it.models import Enterprise


class EnterpriseAPIView(APIView):

    def put(self, request, id):
        enterprise = Enterprise.objects.get(id=id)
        enterprise.visits += 1
        enterprise.save()

        return Response({
            "message": "更新成功",
            "success": True
        })